<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Compound Formats</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetime.formats.date.html">Date Formats</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetime.formats.relative.html">Relative Formats</a></div>
 <div class="up"><a href="datetime.formats.html">Supported Date and Time Formats</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="datetime.formats.compound" class="section">
  <h2 class="title">Compound Formats</h2>

  <p class="para">
   This page describes the different compound date/time formats that the
   <span class="function"><a href="function.strtotime.html" class="function">strtotime()</a></span>, <a href="class.datetime.html" class="classname">DateTime</a> and
   <span class="function"><a href="function.date-create.html" class="function">date_create()</a></span> parser understands.
  </p>

  <table class="doctable table">
   <caption><strong>Used Symbols</strong></caption>
   
    <thead>
     <tr>
      <th>Description</th>
      <th>Formats</th>
      <th>Examples</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><em>DD</em></td>
      <td>&quot;0&quot; [0-9] | [1-2][0-9] | &quot;3&quot; [01]</td>
      <td>&quot;02&quot;, &quot;12&quot;, &quot;31&quot;</td>
     </tr>

     <tr>
      <td><em>doy</em></td>
      <td>&quot;00&quot;[1-9] | &quot;0&quot;[1-9][0-9] | [1-2][0-9][0-9] | &quot;3&quot;[0-5][0-9] | &quot;36&quot;[0-6]</td>
      <td>&quot;36&quot;[0-6] &quot;000&quot;, &quot;012&quot;, &quot;366&quot;</td>
     </tr>

     <tr>
      <td><em>frac</em></td>
      <td>. [0-9]+</td>
      <td>&quot;.21342&quot;, &quot;.85&quot;</td>
     </tr>

     <tr>
      <td><em>hh</em></td>
      <td>&quot;0&quot;?[1-9] | &quot;1&quot;[0-2]</td>
      <td>&quot;04&quot;, &quot;7&quot;, &quot;12&quot;</td>
     </tr>

     <tr>
      <td><em>HH</em></td>
      <td>[01][0-9] | &quot;2&quot;[0-4]</td>
      <td>&quot;04&quot;, &quot;7&quot;, &quot;19&quot;</td>
     </tr>

     <tr>
      <td><em>meridian</em></td>
      <td>[AaPp] .? [Mm] .? [\0\t ]</td>
      <td>&quot;A.m.&quot;, &quot;pM&quot;, &quot;am.&quot;</td>
     </tr>

     <tr>
      <td><em>ii</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;04&quot;, &quot;8&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>II</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;04&quot;, &quot;08&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>M</em></td>
      <td>&#039;jan&#039; | &#039;feb&#039; | &#039;mar&#039; | &#039;apr&#039; | &#039;may&#039; | &#039;jun&#039; | &#039;jul&#039; | &#039;aug&#039; | &#039;sep&#039; | &#039;sept&#039; | &#039;oct&#039; | &#039;nov&#039; | &#039;dec&#039;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><em>MM</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;00&quot;, &quot;12&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>space</em></td>
      <td>[ \t]</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><em>ss</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;04&quot;, &quot;8&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>SS</em></td>
      <td>[0-5][0-9]</td>
      <td>&quot;04&quot;, &quot;08&quot;, &quot;59&quot;</td>
     </tr>

     <tr>
      <td><em>W</em></td>
      <td>&quot;0&quot;[1-9] | [1-4][0-9] | &quot;5&quot;[0-3]</td>
      <td>&quot;05&quot;, &quot;17&quot;, &quot;53&quot;</td>
     </tr>

     <tr>
      <td><em>tzcorrection</em></td>
      <td>&quot;GMT&quot;? [+-] <em>hh</em> &quot;:&quot;? <em>MM</em>?</td>
      <td>&quot;+0400&quot;, &quot;GMT-07:00&quot;, &quot;-07:00&quot;</td>
     </tr>

     <tr>
      <td><em>YY</em></td>
      <td>[0-9]{4}</td>
      <td>&quot;2000&quot;, &quot;2008&quot;, &quot;1978&quot;</td>
     </tr>

    </tbody>
   
  </table>


  <table class="doctable table">
   <caption><strong>Localized Notations</strong></caption>
   
    <thead>
     <tr>
      <th>Description</th>
      <th>Format</th>
      <th>Examples</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>Common Log Format</td>
      <td><em>dd</em> &quot;/&quot; <em>M</em> &quot;/&quot; <em>YY</em> : <em>HH</em> &quot;:&quot; <em>II</em> &quot;:&quot; <em>SS</em> <em>space</em> <em>tzcorrection</em></td>
      <td>&quot;10/Oct/2000:13:55:36 -0700&quot;</td>
     </tr>

     <tr>
      <td>EXIF</td>
      <td><em>YY</em> &quot;:&quot; <em>MM</em> &quot;:&quot; <em>DD</em> &quot; &quot; <em>HH</em> &quot;:&quot; <em>II</em> &quot;:&quot; <em>SS</em></td>
      <td>&quot;2008:08:07 18:11:31&quot;</td>
     </tr>

     <tr>
      <td>ISO year with ISO week</td>
      <td><em>YY</em> &quot;-&quot;? &quot;W&quot; <em>W</em></td>
      <td>&quot;2008W27&quot;, &quot;2008-W28&quot;</td>
     </tr>

     <tr>
      <td>ISO year with ISO week and day</td>
      <td><em>YY</em> &quot;-&quot;? &quot;W&quot; <em>W</em> &quot;-&quot;? [0-7]</td>
      <td>&quot;2008W273&quot;, &quot;2008-W28-3&quot;</td>
     </tr>

     <tr>
      <td>MySQL</td>
      <td><em>YY</em> &quot;-&quot; <em>MM</em> &quot;-&quot; <em>DD</em> &quot; &quot; <em>HH</em> &quot;:&quot; <em>II</em> &quot;:&quot; <em>SS</em></td>
      <td>&quot;2008-08-07 18:11:31&quot;</td>
     </tr>

     <tr>
      <td>PostgreSQL: Year with day-of-year</td>
      <td><em>YY</em> &quot;.&quot;? <em>doy</em></td>
      <td>&quot;2008.197&quot;, &quot;2008197&quot;</td>
     </tr>

     <tr>
      <td>SOAP</td>
      <td><em>YY</em> &quot;-&quot; <em>MM</em> &quot;-&quot; <em>DD</em> &quot;T&quot; <em>HH</em> &quot;:&quot; <em>II</em> &quot;:&quot; <em>SS</em> <em>frac</em> <em>tzcorrection</em>?</td>
      <td>&quot;2008-07-01T22:35:17.02&quot;, &quot;2008-07-01T22:35:17.03+08:00&quot;</td>
     </tr>

     <tr>
      <td>Unix Timestamp</td>
      <td>&quot;@&quot; &quot;-&quot;? [0-9]+</td>
      <td>&quot;@1215282385&quot;</td>
     </tr>

     <tr>
      <td>XMLRPC</td>
      <td><em>YY</em> <em>MM</em> <em>DD</em> &quot;T&quot; <em>hh</em> &quot;:&quot; <em>II</em> &quot;:&quot; <em>SS</em></td>
      <td>&quot;20080701T22:38:07&quot;, &quot;20080701T9:38:07&quot;</td>
     </tr>

     <tr>
      <td>XMLRPC (Compact)</td>
      <td><em>YY</em> <em>MM</em> <em>DD</em> &#039;t&#039; <em>hh</em> <em>II</em> <em>SS</em></td>
      <td>&quot;20080701t223807&quot;, &quot;20080701T093807&quot;</td>
     </tr>

     <tr>
      <td>WDDX</td>
      <td><em>YY</em> &quot;-&quot; <em>mm</em> &quot;-&quot; <em>dd</em> &quot;T&quot; <em>hh</em> &quot;:&quot; <em>ii</em> &quot;:&quot; <em>ss</em></td>
      <td>&quot;2008-7-1T9:3:37&quot;</td>
     </tr>

    </tbody>
   
  </table>


  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The &quot;W&quot; in the &quot;ISO year with ISO week&quot; and &quot;ISO year with ISO week
    and day&quot; formats is case-sensitive, you can only use the upper case
    &quot;W&quot;.
   </p>
   <p class="para">
    The &quot;T&quot; in the SOAP, XMRPC and WDDX formats is case-sensitive, you
    can only use the upper case &quot;T&quot;.
   </p>
   <p class="para">
    The &quot;Unix Timestamp&quot; format sets the timezone to UTC.
   </p>
  </p></blockquote>
 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetime.formats.date.html">Date Formats</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetime.formats.relative.html">Relative Formats</a></div>
 <div class="up"><a href="datetime.formats.html">Supported Date and Time Formats</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
